#include <bits/stdc++.h>
using namespace std;
const int N = N ;
int prime[N];

void shai() {
  prime[1] = 1;
  prime[0] = 1;
  for (int i = 2; i * i < N; i++) {
    if (prime[i] == 1) {
      continue;
    }
    for (int j = i; i * j < N; j++) {
      prime[i * j] = 1;
    }
  }
} // 质数表

int main() {
  shai();
  int a, b, box = 0;
  cin >> a >> b;
  for (int i = a; i <= b; i++) {
    if (prime[i] == 0 && prime[i / 10] == 0) {
      cout << i << endl;
      box++;
    }
  }
  if (box == 0)
    cout << "None";
  return 0;
}